

/**
 * @author Carlos
 * @version 1.0
 * @created 09-oct-2013 05:23:53 p.m.
 */
using System.Xml;
using Imaginarium.XML;
namespace Imaginarium.battleSistem
{
    public class BattleOption{

        public BattleOptionEnum type { get; set; }
        public string name { get; set; }
        public string description { get; set; } //DIDIT In a not that long time in a not far far galaxy
        public enum BattleOptionEnum
        {
            Attack,
            Inventory,
            Defend,
            Ability,
            SpecificAbility
        }
        public BattleOption(BattleOptionEnum type, string name)
        {
            this.type = type;
            this.name = name;
        }
        public BattleOption(BattleOptionEnum type)
        {
            this.type = type;
            this.name = toString();
        }
        public BattleOption(XmlElement element) {
            this.type = (BattleOptionEnum)XmlHelper.getIntByTagname(element, XmlParameters.BATTLE_OPTION_TYPE);
            this.name = XmlHelper.getStringByTagname(element, XmlParameters.BATTLE_OPTION_NAME);
            this.name = XmlHelper.getStringByTagname(element, XmlParameters.BATTLE_OPTION_DESCRIPTION);
            if (name == null || "".Equals(name)) {
                name = toString();
            }
        }
        public string toString() 
        {
            switch(type){
                case BattleOptionEnum.Ability:
                    return "Ability";
                case BattleOptionEnum.Attack:
                    return "Attack";
                case BattleOptionEnum.Defend:
                    return "Defend";
                case BattleOptionEnum.Inventory:
                    return "Inventory";
                default:
                    return "WTF";
            }
        }
    }
}